﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace FileConvert
{
    /// <summary>
    /// 提供FLV文件格式的转换
    /// </summary>
    internal class MP4Convert : ConvertBase, IFileConvert
    {

        #region IFileConvert 成员
        public MessageEntity Convert(string path)
        {
            return Convert(path, false);
        }
        public MessageEntity Convert(string path, bool IsGenerateImage)
        {
            string videoSize = System.Configuration.ConfigurationManager.AppSettings["VideoSize"] ?? "720*408";
            return base.ConvertFile("ffmpeg  -i {0} -f mp4  -vcodec h264 -y  -strict -2 -acodec aac -vol 256 -aspect 16:9 -s " + videoSize + " -b:v 512k {1}"
                , ".mp4"
                , path
                , IsGenerateImage);
        }
        #endregion

    }
}